import request from '@utils/request.js'

// 登录
const login = (params = {}) => request.post('/login', params)

// 获取侧边栏列表数据
const getMenuLists = () => request.get('/menus')

// 获取用户列表
const getUserList = (params = {}) => request.get('/users', { params })

// 用户信息状态变更
const toChangeUserState = (uid, type) => request.put(`users/${uid}/state/${type}`)

// 添加用户
const toAddUser = (params = {}) => request.post('/users', params)

// 编辑用户信息
const getUserInfo = (id) => request.get(`users/${id}`)

// 删除用户
const delUserInfo = (id) => request.delete(`users/${id}`)

export {
  login,
  getMenuLists,
  getUserList,
  toChangeUserState,
  toAddUser,
  getUserInfo,
  delUserInfo
}
